GtkSnapshot: Drop init/finish
authorMatthias Clasen <mclasen@redhat.com>
Sun, 11 Mar 2018 02:20:25 +0000 (21:20 -0500)
committerMatthias Clasen <mclasen@redhat.com>
Sun, 11 Mar 2018 05:31:44 +0000 (00:31 -0500)
We are ont using stack-allocated snapshots anymore.

gtk/gtksnapshot.c
gtk/gtksnapshotprivate.h

index 7956eba43a3b6ecd74f73831cf843ab9e0d87098..88997155a8d11abbb7ca1db9e4a66800eb8f0af6 100644 (file)
@@ -156,52 +156,6 @@ gtk_snapshot_state_clear (GtkSnapshotState *state)
   g_clear_pointer (&state->name, g_free);
 }
 
-static void
-gtk_snapshot_init_internal (GtkSnapshot          *snapshot,
-                            GskRenderer          *renderer,
-                            gboolean              record_names,
-                            const cairo_region_t *clip,
-                            char                 *name)
-{
-  snapshot->record_names = record_names;
-  snapshot->renderer = renderer;
-  snapshot->state_stack = g_array_new (FALSE, TRUE, sizeof (GtkSnapshotState));
-  g_array_set_clear_func (snapshot->state_stack, (GDestroyNotify)gtk_snapshot_state_clear);
-  snapshot->nodes = g_ptr_array_new_with_free_func ((GDestroyNotify)gsk_render_node_unref);
-
-  gtk_snapshot_push_state (snapshot,
-                           name,
-                           (cairo_region_t *) clip,
-                           0, 0,
-                           gtk_snapshot_collect_default);
-}
-
-void
-gtk_snapshot_init (GtkSnapshot          *snapshot,
-                   GskRenderer          *renderer,
-                   gboolean              record_names,
-                   const cairo_region_t *clip,
-                   const char           *name,
-                   ...)
-{
-  char *str;
-
-  if (name && record_names)
-    {
-      va_list args;
-
-      va_start (args, name);
-      str = g_strdup_vprintf (name, args);
-      va_end (args);
-    }
-  else
-    str = NULL;
-
-  snapshot->ref_count = 0;
-
-  gtk_snapshot_init_internal (snapshot, renderer, record_names, clip, str);
-}
-
 GtkSnapshot *
 gtk_snapshot_new (GskRenderer          *renderer,
                                                            gboolean              record_names,
@@ -226,7 +180,17 @@ gtk_snapshot_new (GskRenderer          *renderer,
   snapshot = g_new (GtkSnapshot, 1);
   snapshot->ref_count = 1;
 
-  gtk_snapshot_init_internal (snapshot, renderer, record_names, clip, str);
+  snapshot->record_names = record_names;
+  snapshot->renderer = renderer;
+  snapshot->state_stack = g_array_new (FALSE, TRUE, sizeof (GtkSnapshotState));
+  g_array_set_clear_func (snapshot->state_stack, (GDestroyNotify)gtk_snapshot_state_clear);
+  snapshot->nodes = g_ptr_array_new_with_free_func ((GDestroyNotify)gsk_render_node_unref);
+
+  gtk_snapshot_push_state (snapshot,
+                           str,
+                           (cairo_region_t *) clip,
+                           0, 0,
+                           gtk_snapshot_collect_default);
 
   return snapshot;
 }
@@ -1180,12 +1144,6 @@ gtk_snapshot_to_node (GtkSnapshot *snapshot)
   return result;
 }
 
-GskRenderNode *
-gtk_snapshot_finish (GtkSnapshot *snapshot)
-{
-  return gtk_snapshot_to_node (snapshot);
-}
-
 /**
  * gtk_snapshot_pop:
  * @snapshot: a #GtkSnapshot
index 9a8659063cc6ef8b7a9b519611026fa1366d30bc..f2117bb43f1bf369ac272b030ec21d8c98ca1427 100644 (file)
@@ -88,14 +88,6 @@ struct _GtkSnapshot {
   GPtrArray             *nodes;
 };
 
-void            gtk_snapshot_init               (GtkSnapshot             *state,
-                                                 GskRenderer             *renderer,
-                                                 gboolean                 record_names,
-                                                 const cairo_region_t    *clip,
-                                                 const char              *name,
-                                                 ...) G_GNUC_PRINTF (5, 6);
-GskRenderNode * gtk_snapshot_finish             (GtkSnapshot             *state);
-
 GskRenderer *   gtk_snapshot_get_renderer       (const GtkSnapshot       *snapshot);
 
 G_END_DECLS